part of _;

extension on ShowPicturePage {
  void controller_showActions() {
    yShowActionSheet("请选择", ["保存图片"], (_, action) async {
      switch (action) {
        case "保存图片":
          if (yIsWeb)
            html.window.open(pictures[index], "");
          else {
            yShowProgress();
            GallerySaver.saveImage(pictures[index]).then((isSuccess) {
              yDismissProgress();
              yToast((isSuccess ?? false) ? "图片保存成功" : "图片保存失败");
            });
          }
          break;
      }
    });
  }
}
